import store from "@/store";
import dayjs from 'dayjs';
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};
export const formBase = [
  {
    label: '日期',
    type: 'daterange',
    field: 'shelfTime',
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: '至',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        shortcuts: [ {
          text: "今天",
          onClick(picker) {
            const end = dayjs().format("YYYY-MM-DD 23:59:59");
            const start = dayjs().format("YYYY-MM-DD 00:00:00");
            picker.$emit("pick", [start, end]);
          },
        },
          {
            text: "昨天",
            onClick(picker) {
              const end = dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().subtract(1, 'day').format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = dayjs().subtract(3, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = dayjs().subtract(7, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().format('YYYY-MM-DD 23:59:5');
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = dayjs().subtract(30, 'day').format('YYYY-MM-DD 00:00:00')
              const start = dayjs().format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },]
      }
    }
  },
  {
    label: '仓库',
    type: 'select',
    field: 'storage',
    optionsKey: 'warehouseName',
    optionsValue: 'id',
    options: store.state.custom_dict.warehouse,
  },
  {
    label: "目的地",
    type: "select",
    required: true,
    field: "destination",
    optionsKey: "destinationName",
    optionsValue: "destinationId",
    options: store.state.custom_dict.destination,
  }
];

export const tableBase = [
  {
    label: "复核时间",
    prop: "recheckTime",
    width: "200",
    operate: {
      type: "input",
      field: "recheckTime",
    },
  },
  {
    label: "会员ID",
    prop: "userId",
    width: "200",
    operate: {
      type: "input",
      field: "userId",
    },
  },
  {
    label: "会员名字",
    prop: "userName",
    width: "200",
    operate: {
      type: "input",
      field: "userName",
    },
  },
  {
    label: "转运单号",
    prop: "transitOrderNo",
    width: 150,
    operate: {
      type: "input",
      field: "transitOrderNo",
    },
  },
  {
    label: "件数",
    prop: "pieces",
    width: 150,
    operate: {
      type: "input",
      field: "pieces",
    },
  },
  {
    label: "实际重",
    prop: "actualWeight",
    width: 150,
    operate: {
      type: "input",
      field: "actualWeight",
    },
  },
  {
    label: "核算重",
    prop: "recheckWeight",
    width: 150,
    operate: {
      type: "input",
      field: "recheckWeight",
    },
  },
  {
    label: "复核仓",
    prop: "recheckStorage",
    width: 200,
    operate: {
      type: "input",
      field: "recheckStorage",
    },
  },
  {
    label: "复核员",
    prop: "recheckName",
    width: 200,
    operate: {
      type: "input",
      field: "recheckName",
    },
  },
  {
    label: "备注",
    prop: "remarks",
    width: 200,
    operate: {
      type: "input",
      field: "remarks",
    },
  },
  {
    label: "是否错误",
    prop: "mistake",
    width: 200,
    operate: {
      type: "input",
      field: "mistake",
    },
  },
  {
    label: "长",
    prop: "longs",
    width: 200,
    operate: {
      type: "input",
      field: "longs",
    },
  },
  {
    label: "宽",
    prop: "widths",
    width: 200,
    operate: {
      type: "input",
      field: "widths",
    },
  },
  {
    label: "高",
    prop: "heights",
    width: 150,
    operate: {
      type: "input",
      field: "heights",
    },
  },
  {
    label: "立方数",
    prop: "cubicCount",
    width: 150,
    operate: {
      type: "input",
      field: "cubicCount",
    },
  },
  {
    label: "体积重",
    prop: "volumeWeight",
    width: 150,
    operate: {
      type: "input",
      field: "volumeWeight",
    },
  },
];
